<?php use_helper('I18N') ?>
<h1><?php echo __('contact form title', array(), 'tmcContactPlugin') ?></h1>

<?php if ( $sf_user->hasFlash('object') ): ?>
<div class="alert success">
  <?php echo __('%name%, contact form submitted successfully', array(
      '%name%' => $sf_user->getFlash('object')->getName(),
      '%email%' => $sf_user->getFlash('object')->getEmail(),
      ), 'tmcContactPlugin') ?>
</div>
<?php else: ?>
  <?php if ($form->hasErrors() && sfConfig::get('app_tmcContactPlugin_show_errors_top', true)): ?>
    <div class="alert error">
      <ul>
        <?php foreach ($form->getErrorSchema()->getErrors() as $field => $error): ?>
        <li><?php echo __(ucfirst($field), array(), 'tmcContactPlugin') ?>: <?php echo __($error, array(), 'tmcContactPlugin') ?></li>
        <?php endforeach ?>
      </ul>
    </div>
  <?php endif; ?>

  <form id="<?php echo sfConfig::get('app_tmcContactPlugin_contact_form_id', 'contact_form') ?>" method="post" action="<?php echo url_for('@tmc_contact_form') ?>">
    <table>
      <?php echo $form ?>
      <tr>
        <td colspan="2">
          <input type="submit" value="<?php echo __('Submit', array(), 'tmcContactPlugin') ?>" />
        </td>
      </tr>
    </table>
  </form>
<?php endif; ?>